var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
(function () {
    // 继承： 类与类之间的关系
    // 继承后类与类之间的叫法
    // A 类继承了B这个类， 那么此时 A类叫子类，B类叫基类
    // 子类----> 派生类
    // 基类----> 超类(父类)
    var Person = /** @class */ (function () {
        function Person(name, age, gender) {
            this.name = name;
            this.age = age;
            this.gender = gender;
        }
        Person.prototype.sayHi = function () {
            console.log("\u6211\u662F\uFF1A" + this.name);
        };
        return Person;
    }());
    // 定义一个学生类， 继承自 Person
    var Student = /** @class */ (function (_super) {
        __extends(Student, _super);
        function Student(name, age, gender) {
            return _super.call(this, name, age, gender) || this;
        }
        Student.prototype.sayHi = function () {
            console.log('我是 student 类');
            _super.prototype.sayHi.call(this);
        };
        return Student;
    }(Person));
    var person = new Person('小明', 21, '男');
    person.sayHi();
    var stu = new Student('小红', 21, '女');
    stu.sayHi();
    // 总结： 类和类继承， 用 extends 
    // 子类中使用父类的属性和方法，用 super
    // 子类可以重写父类的方法
})();
